#!/usr/bin/env python3

import sys

class StudentError(Exception):
    def __init__(self, *args, **kargs):
        super().__init__(*args, **kargs)
        self.message = "\033[31m学生系统错误:\033[0m " + self.args[0]

    def __str__(self):
        return self.message

def main():
    try:
        raise StudentError("添加失败", 1)
    except StudentError as e:
        #  print(e)
        print(sys.exc_info())

if __name__ == "__main__":
    main()
